//
//  DXWLoginView.m
//  BuDeJie
//
//  Created by 淡馨慰 on 16/8/5.
//  Copyright © 2016年 淡馨慰. All rights reserved.
//

#import "DXWLoginRegisterView.h"

@interface DXWLoginRegisterView ()

@property (weak, nonatomic) IBOutlet UIButton *loginBtn;

@end

@implementation DXWLoginRegisterView

- (void)awakeFromNib
{
//    self.autoresizingMask = UIViewAutoresizingNone;
    
    //登入按钮使用美工提供的圆角图片
    UIImage *btnImage = [self.loginBtn backgroundImageForState:UIControlStateNormal];
    //将图片从中点拉伸
   btnImage = [btnImage stretchableImageWithLeftCapWidth:btnImage.size.width * 0.5 topCapHeight:btnImage.size.height * 0.5];
    [_loginBtn setBackgroundImage:btnImage forState:UIControlStateNormal];
    UIImage *btnImageHL = [self.loginBtn backgroundImageForState:UIControlStateHighlighted];
    //将图片从中点拉伸
   btnImageHL = [btnImageHL stretchableImageWithLeftCapWidth:btnImage.size.width * 0.5 topCapHeight:btnImage.size.height * 0.5];
    [_loginBtn setBackgroundImage:btnImageHL forState:UIControlStateHighlighted];

}

+ (instancetype)loginView
{
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil]firstObject];
}

+ (instancetype)registerView
{
        return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil]lastObject];
}

@end
